export const FormAttr = {
    attribute: {
        basicAttr: {
            type: {
                "key": "type",
                "label": "组件类型",
                "data": [{
                    "label": "单行文本",
                    "type": "textSingle"
                }, {
                    "label": "多行文本",
                    "type": "textArea"
                }],
                "value": "xxx",
                "type": "select"
            },
            fieldName: {
                "key": "fieldName",
                "label": "字段名",
                "value": "xxx",
                "type": "textSingle"
            },
            label: {
                "key": "label",
                "label": "标题",
                "value": "xxx",
                "type": "textSingle"
            },
            placeholder: {
                "key": "placeholder",
                "label": "输入提示",
                "value": "xxx",
                "type": "textSingle"
            },
            labelWidth: {
                "key": "labelWidth",
                "label": "表单宽度",
                "value": 120,
                "type": "number"
            },
            componentWidth: {
                "key": "componentWidth",
                "label": "组件宽度",
                "value": "100%",
                "type": "textSingle"
            },
            defaultValue: {
                "key": "defaultValue",
                "label": "默认值",
                "value": "xxx",
                "type": "textSingle"
            },
            spanNum: {
                "key": "spanNum",
                "label": "表单栅格数",
                "value": 24,
                "type": "slider"
            }
        },
        booleanAttr: {
            showLabel: {
                "key": "showLabel",
                "label": "显示标签",
                "value": true,
                "type": "switch"
            },
            onlyRead: {
                "key": "onlyRead",
                "label": "是否只读",
                "value": false,
                "type": "switch"
            },
            disabled: {
                "key": "disabled",
                "label": "是否禁用",
                "value": false,
                "type": "switch"
            },
            quired: {
                "key": "quired",
                "label": "是否必填",
                "value": false,
                "type": "switch"
            },
        },
        ruleAttr: {
            rules: {
                "key": "rules",
                "label": "正则校验",
                "data": [{
                    "reg": "",
                    "msg": "提示数据"
                }],
                "type": "rules"
            }
        }
    }
}

export const form = [{
        name: '单行文本',
        type: 'textSingle',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '多行文本',
        type: 'textArea',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            minRow: {
                "key": "minRow",
                "label": "最小行数",
                "value": 8,
                "type": "number"
            },
            maxRow: {
                "key": "maxRow",
                "label": "最大行数",
                "value": 8,
                "type": "number"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '密码框',
        type: 'password',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '计算器',
        type: 'number',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '选择器',
        type: 'select',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            selectData: {
                "key": "selectData",
                "label": "静态数据",
                "extendData": [{
                        value: 'Option1',
                        label: 'Option1',
                    },
                    {
                        value: 'Option2',
                        label: 'Option2',
                    },
                    {
                        value: 'Option3',
                        label: 'Option3',
                    },
                    {
                        value: 'Option4',
                        label: 'Option4',
                    },
                    {
                        value: 'Option5',
                        label: 'Option5',
                    },
                ],
                "type": "selectStaticData"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '级联选择器',
        type: 'cascader',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            "cascaderData": {
                "key": "cascaderData",
                "label": "静态数据",
                "extendData": [{
                    value: 'guide',
                    label: 'Guide',
                    children: [{
                            value: 'disciplines',
                            label: 'Disciplines',
                            children: [{
                                    value: 'consistency',
                                    label: 'Consistency',
                                },
                                {
                                    value: 'feedback',
                                    label: 'Feedback',
                                },
                                {
                                    value: 'efficiency',
                                    label: 'Efficiency',
                                },
                                {
                                    value: 'controllability',
                                    label: 'Controllability',
                                },
                            ],
                        },
                        {
                            value: 'navigation',
                            label: 'Navigation',
                            children: [{
                                    value: 'side nav',
                                    label: 'Side Navigation',
                                },
                                {
                                    value: 'top nav',
                                    label: 'Top Navigation',
                                },
                            ],
                        },
                    ],
                }, ],
                "type": "cascaderStaticData"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    },
    {
        name: '单选框组',
        type: 'radioGroup',
        attribute: {
            ...JSON.parse(JSON.stringify(FormAttr.attribute.basicAttr)),
            frontIcon: {
                "key": "frontIcon",
                "label": "前置图标",
                "value": 6,
                "type": "textSingleFrontIcon"
            },
            postIcon: {
                "key": "postIcon",
                "label": "后置图标",
                "value": 6,
                "type": "textSinglePostIcon"
            },
            prefix: {
                "key": "prefix",
                "label": "前缀",
                "value": 6,
                "type": "textSingle"
            },
            suffix: {
                "key": "suffix",
                "label": "后缀",
                "value": 6,
                "type": "textSingle"
            },
            max: {
                "key": "max",
                "label": "最大输入",
                "value": 6,
                "type": "textSingleSuffix"
            },
            radioGroupData: {
                "key": "radioGroupData",
                "label": "单选按钮组静态数据",
                "value": [{
                        "label": "按钮A",
                        "value": 1
                    },
                    {
                        "label": "按钮B",
                        "value": 2
                    },
                    {
                        "label": "按钮C",
                        "value": 3
                    }
                ],
                "radioGroup": "radioGroupStaticData"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.booleanAttr)),
            clear: {
                "key": "clear",
                "label": "能否清空",
                "value": false,
                "type": "switch"
            },
            ...JSON.parse(JSON.stringify(FormAttr.attribute.ruleAttr))
        }
    }
]

[{
        "value": "Option1",
        "label": "Option1"
    },
    {
        "value": "Option2",
        "label": "Option2"
    },
    {
        "value": "Option3",
        "label": "Option3"
    },
    {
        "value": "Option4",
        "label": "Option4"
    },
    {
        "value": "Option5",
        "label": "Option5"
    }
]
[
    {
        label: '年',
        value: 'year'
    },
    {
        label: '月',
        value: 'month'
    },
    {
        label: '基础日期',
        value: 'date'
    },
    {
        label: '日期',
        value: 'dates'
    },
    {
        label: '日期时间',
        value: 'datetime'
    },
    {
        label: '周',
        value: 'week'
    },
    {
        label: '日期时间范围',
        value: 'datetimerange'
    },
    {
        label: '日期范围',
        value: 'daterange'
    },
    {
        label: '月份范围',
        value: 'monthrange'
    }
]
